Fix alignment and icons in spin buttons
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 27 Jan 2009 19:22:56 +0000 (19:22 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 27 Jan 2009 19:22:56 +0000 (19:22 +0000)
svn path=/trunk/; revision=22242

ChangeLog
gtk/gtkentry.c

index c9f62ebcbe780c609b5d0865f2efd2126ad026bc..7606de78e5773af5391389c59a6cf99e2b56d1f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-27  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentry.c: Use the get_text_area_size vfunc to make
+       alignment and icons in spin buttons work correctly.
+
 2009-01-27  Matthias Clasen  <mclasen@redhat.com>
        
        Bug 569336 – change in gtkbutton klass is causing crash when 
index d4b66f51573235fee7cda1a69aec3e6527cc1ac8..36bcee6bf429ce494d76b54b7e48af5bcd1c6beb 100644 (file)
@@ -449,8 +449,6 @@ static void         gtk_entry_do_popup                 (GtkEntry       *entry,
                                                        GdkEventButton *event);
 static gboolean     gtk_entry_mnemonic_activate        (GtkWidget      *widget,
                                                        gboolean        group_cycling);
-static void         gtk_entry_state_changed            (GtkWidget      *widget,
-                                                       GtkStateType    previous_state);
 static void         gtk_entry_check_cursor_blink       (GtkEntry       *entry);
 static void         gtk_entry_pend_cursor_blink        (GtkEntry       *entry);
 static void         gtk_entry_reset_blink_time         (GtkEntry       *entry);
@@ -459,6 +457,11 @@ static void         gtk_entry_get_text_area_size       (GtkEntry       *entry,
                                                        gint           *y,
                                                        gint           *width,
                                                        gint           *height);
+static void         get_text_area_size                 (GtkEntry       *entry,
+                                                       gint           *x,
+                                                       gint           *y,
+                                                       gint           *width,
+                                                       gint           *height);
 static void         get_widget_window_size             (GtkEntry       *entry,
                                                        gint           *x,
                                                        gint           *y,
@@ -2246,7 +2249,7 @@ get_icon_allocations (GtkEntry      *entry,
   GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry);
   gint x, y, width, height;
 
-  gtk_entry_get_text_area_size (entry, &x, &y, &width, &height);
+  get_text_area_size (entry, &x, &y, &width, &height);
 
   primary->y = y;
   primary->height = height;
@@ -2601,7 +2604,7 @@ gtk_entry_realize (GtkWidget *widget)
   widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
   gdk_window_set_user_data (widget->window, entry);
 
-  gtk_entry_get_text_area_size (entry, &attributes.x, &attributes.y, &attributes.width, &attributes.height);
+  get_text_area_size (entry, &attributes.x, &attributes.y, &attributes.width, &attributes.height);
  
   if (GTK_WIDGET_IS_SENSITIVE (widget))
     {
@@ -2775,7 +2778,7 @@ place_windows (GtkEntry *entry)
   GtkAllocation secondary;
   EntryIconInfo *icon_info = NULL;
 
-  gtk_entry_get_text_area_size (entry, &x, &y, &width, &height);
+  get_text_area_size (entry, &x, &y, &width, &height);
 
   get_icon_allocations (entry, &primary, &secondary);
 
@@ -2835,6 +2838,24 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
     *height = requisition.height - yborder * 2;
 }
 
+static void
+get_text_area_size (GtkEntry *entry,
+                    gint     *x,
+                    gint     *y,
+                    gint     *width,
+                    gint     *height)
+{
+  GtkEntryClass *class;
+
+  g_return_if_fail (GTK_IS_ENTRY (entry));
+
+  class = GTK_ENTRY_GET_CLASS (entry);
+
+  if (class->get_text_area_size)
+    class->get_text_area_size (entry, x, y, width, height);
+}
+
+
 static void
 get_widget_window_size (GtkEntry *entry,
                         gint     *x,